package com.yzc.mihuyou.controller;


import com.yzc.mihuyou.entity.Plate;
import com.yzc.mihuyou.entity.User;
import com.yzc.mihuyou.service.PlateService;
import com.yzc.mihuyou.vo.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.web.multipart.MultipartFile;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 易紫诚
 * @since 2022-04-29
 */
@RestController
@RequestMapping("/mihuyou/plate")
public class PlateController {

    @Autowired
    PlateService plateService;

    @PostMapping("charu")
    public JsonResult su(@RequestPart("photos") MultipartFile photos){
        plateService.importProfession(photos);
        return  new JsonResult();
    }

    @GetMapping("chaxun")
    public  JsonResult chaxun(){
        Map<String,Object> map=new HashMap<>();
        map.put("plateLisr",plateService.plateList());
        return new JsonResult(200,"查询成功",map);
    }

}

